package org.jackysoft.entity;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.GenericGenerator;
import org.jackysoft.annotations.BID;
import org.jackysoft.annotations.OptionalValue;

/**
 * 用于用string 做Id的实体类,
 * 适合普通PO,Id作为主键编号,uuid类型
 * */
@MappedSuperclass
public abstract class AbstractEntity extends AbstractCustomeEntity{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6921077822536164802L;
	protected String id;   
	
	
	@Id
	@BID
	@OptionalValue
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id+"";
	}	
}
